package com.yoxio.scanservice.controller;

import com.alibaba.fastjson.JSONObject;
import com.yoxio.scanservice.service.ScanService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author pht
 * @date 2021/10/22 15:32
 */
@RestController
@RequestMapping("/scan")
@CrossOrigin
public class ScanController {

    @Resource
    private ScanService scanService;

    /**
     * 获取二维码内容
     *
     * @return
     */
    @GetMapping("/getQrcodeContent")
    public JSONObject getScanParam() {
      return scanService.getScanParam();
    }
    @GetMapping("/getQrcodeStatus")
    public JSONObject getQrcodeStatus(String token) {
      return scanService.getQrcodeStatus(token);
    }

}
